-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(): searchPossibleTargets
targets
value
#9343
Conversation
Build Stats
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a good incremental fix but there are a few more things to address here.
Even though all tests pass it does not mean that event firing is correct.
Seems there are no tests covering these cases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Migrated all findTarget
tests, see 0c04292
I have decided not to remove the old ones yet so we prove the PR passes (eventhough I did a thorough job of migrating the tests). I kept the names of the tests the same to make it easy to trace back.
c1448b0 contains new tests about my concerns raised in the review FIXED by 40c725b
582b545
to
6e9942d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- dep
searchPossibleTargets
=>findTargets
- move setting
targets
tofindTarget
because it varies on the case and is a step towards refactoring the use ofCanvas#targets
Now I am happy with this PR
1f92014
to
80eaf25
Compare
`_searchPossibleTargets` => `fintTargetsTraversal`
cleanup typo
jsdoc Update SelectableCanvas.ts
Ported to ShaMan123#5 |
Motivation
Trying to impl a fix for the problem presented in #9329
Being that the group rewrite made
searchPossibleTargets
return a sub target instead of the found taregt to allow deep selection. This surfaced an issue that the use ofCanvas#targets
akasubTargets
is wrong and confusing.closes #9329
Description
Rethinking and Reconsidering
subTargets
If I go by the name and from what I understand was the original intention I believe
subTargets
should populate the sub targets of the found target.Parents of the found target should not be part of
subTargets
, that is what makes the name confusing. They should not be part mainly because it is clear that they are in the hit region or else the found target would not be found. If anyone including fabric needs the parents it is very simple to walk up the tree.The main use in fabric of
subTargets
is for events. So we need to fix that.I think it is unclear what is expected from the synthetic events.
Changes
_searchPossibleTargets
=>findTargetsTraversal
+ added a flag to allow searching for all hitssearchPossibleTargets
return value to consider an case wheresubTargetCheck: true, interactive: false
group were travesred, so returning the first hit is wrongsearchPossibleTargets
=>findTargets
targets
tofindTarget
because it varies on the case and is a step towards refactoring the use ofCanvas#targets
Gist
The tests came from #9333 if you wish to merge that first, conflicts should resolve to
ours
In Action